package com.itheima.threadPool;

import java.util.TreeSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        //创建线程池对象
        ExecutorService es = Executors.newFixedThreadPool(10);
        //创建任务
        es.submit(()->{
            System.out.println(Thread.currentThread().getName()+"再执行了");
        });

          Thread.sleep(5000);



        es.submit(()->{
            System.out.println(Thread.currentThread().getName()+"再执行了");
        });

        es.shutdown();

    }
}
